﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Billder
{
    public partial class Image : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.HttpMethod == "GET")
            {
                get();
            }
            if (Request.HttpMethod == "POST")
            {
                post();
            }
        }
        protected void post()
        {
            object a = Request.Form;
        }
        protected void get()
        {
            if (Request.QueryString["PK"] == "0")
            {
                if (System.IO.File.Exists(System.Configuration.ConfigurationManager.AppSettings["tmpImagesDir"]  + Request.QueryString["img"]))
                {
                    Response.Redirect("tmpImages/" + Request.QueryString["img"]);
                }
                else
                {
                    Response.Redirect("Images/no_image.gif");
                }
            }
            else
            {
                Response.Redirect("Images/no_image.gif");
            }

        }
    }
}